package com.nacos.temp4.listeners;

import com.purgeteam.dynamic.config.starter.annotation.EnableDynamicConfigEvent;
import com.purgeteam.dynamic.config.starter.event.ActionConfigEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.lang.NonNull;
import org.springframework.stereotype.Component;

@Component
//开启配置变化监听功能
@EnableDynamicConfigEvent
public class NacosListener implements ApplicationListener<ActionConfigEvent> {
    @Override
    public void onApplicationEvent(@NonNull ActionConfigEvent actionConfigEvent) {
        System.out.println(actionConfigEvent.getPropertyMap().toString());
    }
}
